package com.czl.dxpro.dx_10_taskTen;

import java.io.IOException;

import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;


public class DxTenMain {

	public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
		// TODO Auto-generated method stub
	Job job=Job.getInstance();
	job.setJarByClass(DxTenMain.class);
	job.setMapperClass(TenMapper.class);
	job.setMapOutputKeyClass(Text.class);
	job.setMapOutputValueClass(IntWritable.class);
	
	job.setReducerClass(TenReduce.class);
	job.setOutputKeyClass(NullWritable.class);
	job.setOutputValueClass(Text.class);
	//"g://data/dx/DxMatch"
	FileInputFormat.addInputPath(job, new Path("d://data/dx/DxMatch"));
	//"g://data/dx/Dxcollect"
	FileOutputFormat.setOutputPath(job, new Path("d://data/dx/DxTen"));
	System.exit(job.waitForCompletion(true)?0:1);
	}

}

